OmniIndex Authorization topic

Auth

===========================

a Dart class called AuthService that is responsible for managing user authentication and communication with the authentication service. It provides methods for user login, user registration, password reset, and user sign-out. The class also handles different authentication methods such as email, Google, and Apple. It uses the Firebase authentication library for authentication and the OmniIndex library for fetching user profile details from the blockchain.

Inputs

  • 'username': A string representing the username or email address of the user.
  • 'password': A string representing the password of the user.
  • 'nickname': A string representing the nickname of the user.
  • 'type': An integer representing the type of authentication method to be used.

Flow

  • The class initializes with an instance of the Firebase authentication library and sets the initial client status to 'uninitialized'.
  • The 'login' method is called with the username, password, and authentication type.
  • Based on the authentication type, the method performs the corresponding authentication process using the Firebase authentication library or the Google Sign-In library.
  • If the authentication is successful, the user details are stored in the 'user' object and the client status is set to 'authenticated'.
  • The 'getProfile' method is called to fetch additional user profile details from the blockchain using the OmniIndex library.
  • The 'signOut' method is called to sign out the user based on the authentication type.

Outputs

  • 'clientStatus': An enum value representing the current client status (uninitialized, unauthenticated, authenticated).
  • 'authenticatedUser': An object representing the authenticated user.

Usage example

// Create an instance of AuthService with an Authenticator
// in this case it's firebase
import 'package:firebase_auth/firebase_auth.dart';
import 'package:omniindex/src/notifiers/auth_service.dart';

AuthService auth = AuthService.instance(FirebaseAuth.instance);
...
auth.login(username: 'some-username', password: 'some-password', type: 0);
...

Classes

APICredentials OmniIndex Methods OmniIndex Authorization Getting Started
APICredentials class object that represents a set of credentials for accessing a v1 API. Example Usage:
AuthService OmniIndex Methods OmniIndex Authorization Getting Started
AuthService
BasicCredentials OmniIndex Methods OmniIndex Authorization Getting Started
BasicCredentials class object that represents a set of base credentials for extending.
DataValidator OmniIndex Methods OmniIndex Authorization
DataValidator validates various pieces of data based upon the input and the tye passed in. This makes use of the InputDataType enumeration
OmniIndex OmniIndex Methods OmniIndex Authorization OmniIndex Service Getting Started
OmniIndex class object that manages communications between a flutter based project and the omniindex API server/services The OmniIndex class is a Dart class that provides functionality for working with the OmniIndex API. It allows for loading configuration, retrieving domain keys, authorizing the object, and making API calls.
PGBCCredentials OmniIndex Methods OmniIndex Authorization Getting Started
PGBCCredentials class object that represents a set of credentials for accessing a v2 API.
Provider OmniIndex Methods OmniIndex Authorization Getting Started
Provider
User OmniIndex Methods OmniIndex Authorization OmniIndex Users
This class holds a number of the user specific details to be used by the app.